package cn.wolfcode.luowowo.article.mapper;

import cn.wolfcode.luowowo.article.domain.Travel;
import cn.wolfcode.luowowo.article.query.TravelQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    /**
     * 后台审核游记列表查询使用
     * @param qo
     * @return
     */
    List<Travel> selectAll(TravelQuery qo);

    int updateByPrimaryKey(Travel record);

    List<Travel> selectForList(TravelQuery qo);

    List<Travel> selectTravelsByDestIdNumTop3(Long destId);

    /**
     * 后台审核修改状态
     * @param id
     * @param state
     */
    void updateState(@Param("travelId") Long id, @Param("state") Integer state);

    /**
     * 游记增加评论数
     * @param travelId
     */
    void addReplynumByTravelId(Long travelId);

    /**
     * 查询最新评论数量
     * @param travelId
     * @return
     */
    int selectReplynumById(Long travelId);

    /**
     * 查询全部
     * @return
     */
    List<Travel> listAll();

    List<Travel> selectTravels(Long id);

    List selectForList2(TravelQuery qo);

    int selectTravelCountByuserId(Long id);
}